package com.boge.ratelimiter.config;


import com.boge.ratelimiter.valve.impl.RateLimiterValve;
import com.boge.whitelist.DoRateLimiterPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Configuration ： 标注为配置文件
 */
@Configuration
public class RateAutoAutoConfigure {

    @Bean(value = "rateLimiterValve")
    @ConditionalOnMissingBean
    public RateLimiterValve rateLimiterValve(){
        return new RateLimiterValve();
    }

    @Bean(value = "doRateLimiterPoint")
    @ConditionalOnMissingBean
    public DoRateLimiterPoint doRateLimiterPoint(){
        return new DoRateLimiterPoint();
    }
}

  